<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="/thinkphp/Public/bootstrap2.3.2/css/bootstrap.min.css" rel="stylesheet" />
    <title></title>
    <link href="/thinkphp/Public/css/Common.css" rel="stylesheet" />
    <link href="/thinkphp/Public/css/Index2.css" rel="stylesheet" />
    <script type="text/javascript" charset="utf-8" src="/thinkphp/Public/editor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/thinkphp/Public/editor/ueditor.all.min.js"> </script>
       <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
       <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="/thinkphp/Public/editor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
    <div class="container-fluid">
        <div class="row-fluid">
            <h4>自定义菜单</h4>
            <div class="add">
                <a class="btn btn-success" href='<?php echo U("Menu/add");?>'>新增</a>
                <a class="btn btn-warning" href='<?php echo U("Menu/update");?>' style='magin-left:10px;'>更新菜单</a>
            </div>
            <div class="w">
                <div class="span12">
                    <table class="table table-condensed table-bordered table-hover tab">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>菜单名称</th>
                                <th>类型</th>
                                <th>跳转地址/关键字</th>
                                <th>操作</th>
                            </tr>
                            <?php if(is_array($data)): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                                    <td><?php echo ($vo["id"]); ?></td>
                                    <td style='text-align:left !important'><?php echo ($vo["name"]); ?></td>
                                    <td>
                                        <?php if($vo["type"] == 1): ?>关键字
                                        <?php else: ?>
                                            链接<?php endif; ?>
                                    </td>
                                    <td>
                                        <?php if($vo["type"] == 1): echo ($vo["key"]); ?>
                                        <?php else: ?>
                                            <?php echo ($vo["url"]); endif; ?>
                                    </td>
                                    <td><a href='<?php echo U("Menu/edit");?>?id=<?php echo ($vo["id"]); ?>'>修改</a>　<a href='<?php echo U("Menu/del");?>?id=<?php echo ($vo["id"]); ?>' onclick="return confirm('确定要删除吗?')">删除</a></td>
                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                        </thead>
                        <tbody id="tbody"></tbody>
                    </table>
                    <div id="page" class="tr"></div>
                </div>
            </div>
        </div>
    </div>
	<script src="/thinkphp/Public/js/jquery-1.9.1.min.js"></script>
    <script src="/thinkphp/Public/bootstrap2.3.2/js/bootstrap.min.js"></script>
    <script src="/thinkphp/Public/layer-v2.3/layer/layer.js"></script>
    <script src="/thinkphp/Public/js/Index2.js"></script>
</body>
</html>